< previous page page_521 next page >

Page 521
Note
Although most statements are supported in the Immediate window, you can only execute a single line of basic code. To execute multiple statements, you must use colons to separate the statements as shown in the following code:
For J = 1 to 5 : txtColor(J).Text = VbRed : Next J

Other Debugging Tools to Use
Besides all of the tools that you have available to use when debugging your application, there are several other features that you can use that are not so much tools as methods and statements in the Visual Basic language. These enable you to build debugging code into the application and then control these statements by using the command line arguments.
Conditional Compiling and Code
Command line arguments can be used to have the application execute certain sections of code only when a particular argument is passed to the application at startup. The user can enter them by choosing Run from the Start menu and then entering the application name, followed by one or more arguments, as shown in Figure 18.17.
12181-0521a.gif
Figure 18.17.
Running the application from the
Windows 95 Start, Run menu option, passing
debugging arguments on the command line.
This enables you to have debugging code imbedded in your application that will not be executed until you give the user the correct argument to enter on the command line. This is one way of obtaining information from your application when a bug occurs after the application is in use. In addition, this helps you get the information as the user works with the application.
Note
The hardest thing to do is reproduce an error that a user has reported. Without reproducing the error, it is almost impossible to fix the problem.

 
< previous page page_521 next page >

If you like this book, buy it!